// ----------- GLOBAL -------------

@import './vars';
@import './mixins';

body {
  margin: 0;
  color: $color-text-primary;
  font-size: 14px;
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
    '微软雅黑', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
}

// ----------- reset ----------
* {
  box-sizing: border-box;
}

:focus {
  outline-width: 0;
}

.iconfont {
  font-size: inherit;
  -webkit-text-stroke-width: 0;
}

.clearfix {
  @include clearfix();
}

.fx-bt {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fx-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.fx-air {
  flex: 1 1 0;
}

.cursor-pointer {
  cursor: pointer;
}

.text-primary {
  color: $color-primary;
}

.text-success {
  color: $color-success;
}

.text-danger {
  color: $color-danger;
}

.text-warning {
  color: $color-warning;
}

.text-info {
  color: $color-info;
}

// for utils/index@copy2Clipboard
.clipboard-hidden {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 9999;
  opacity: 0;
  border: none;
  width: 10px;
  height: 10px;
}

// 纯 CSS 文字提示
[data-tips] {
  position: relative;

  &[data-disabled='true'] {
    pointer-events: all;
    cursor: default;

    &:active {
      pointer-events: none;
    }
  }

  &::before,
  &::after {
    position: absolute;
    z-index: 100;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    font-size: 12px;
    transform: translate(-10px, 0) scale(0.9166667);
    transform-origin: left center;
    opacity: 0;
  }

  &::after {
    content: attr(data-tips);
    color: $color-white;
    text-decoration: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    padding: 0 8px;
    left: calc(100% + 4px);
    top: calc(50% - 12px);
    background-color: fade-out($color: $background-color-base, $amount: 0.3);
    height: 24px;
  }

  &::before {
    content: '';
    border-style: solid;
    border-width: 4px 4px 4px 0;
    border-color: transparent fade-out($color: $border-color-base, $amount: 0.3);
    left: calc(100% + 1px);
    top: calc(50% - 4px);
  }

  &:hover::after,
  &:hover::before {
    opacity: 1;
    transform: translate(0, 0) scale(0.9166667);
  }
}
